package org.jeecg.modules.fxjdh.service.impl;

import org.jeecg.modules.fxjdh.entity.FxjDh10;
import org.jeecg.modules.fxjdh.entity.FxjDh1010;
import org.jeecg.modules.fxjdh.mapper.FxjDh1010Mapper;
import org.jeecg.modules.fxjdh.mapper.FxjDh10Mapper;
import org.jeecg.modules.fxjdh.service.IFxjDh10Service;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 上访催收
 * @Author: zhaodui
 * @Date:   2020-02-22
 * @Version: V1.0
 */
@Service
public class FxjDh10ServiceImpl extends ServiceImpl<FxjDh10Mapper, FxjDh10> implements IFxjDh10Service {

	@Autowired
	private FxjDh10Mapper fxjDh10Mapper;
	@Autowired
	private FxjDh1010Mapper fxjDh1010Mapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		fxjDh1010Mapper.deleteByMainId(id);
		fxjDh10Mapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			fxjDh1010Mapper.deleteByMainId(id.toString());
			fxjDh10Mapper.deleteById(id);
		}
	}
	
}
